﻿using DataModels.Dto;
using DataModels.Dto.Community;
using Microsoft.AspNetCore.Mvc;
using Utils;

namespace PropertyManagementWebApi.Controllers.Community
{
    public class ButlerEvaluationController(Services.Community.ButlerEvaluationService butlerEvaluationService) : BaseController
    {
        private readonly Services.Community.ButlerEvaluationService _butlerEvaluationService = butlerEvaluationService;

        /// <summary>
        /// 提交评价
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel SubmitEvaluation(ButlerEvaluationinfo info)
        {
            return _butlerEvaluationService.SubmitEvaluation(info);
        }

        /// <summary>
        /// 计算管家满意度统计
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="BuildId"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel CalculateSatisfaction(DateTime? startDate, DateTime? endDate,string HouseUUID)
        {
            return _butlerEvaluationService.CalculateSatisfaction(startDate,endDate, HouseUUID);
        }
    }
}
